home *** CD-ROM | disk | FTP | other *** search
- Path: news.iddis.com!jarnot
- From: jarnot@iddis.com (Kevin J. Jarnot)
- Newsgroups: comp.lang.c
- Subject: Re: What wrong with this code ??????
- Date: 09 Jan 1996 19:57:44 GMT
- Organization: IDD Information Services
- Message-ID: <JARNOT.96Jan9145744@box10.dstar.iddis.com>
- References: <4bjl81$qiu@wumpus.cc.uow.edu.au>
- Reply-To: jarnot@iddis.com
- NNTP-Posting-Host: box10.dstar.iddis.com
- To: tp86@wumpus.cc.uow.edu.au (PAOPENG THEERADECH)
- In-reply-to: tp86@wumpus.cc.uow.edu.au's message of 25 Dec 1995 00:40:17 +1100
-
- >>>>> "PAOPENG" == PAOPENG THEERADECH <tp86@wumpus.cc.uow.edu.au> writes:
-
- PAOPENG> #include <stdio.h>
- PAOPENG> /* copy input to output */
- PAOPENG> main()
- PAOPENG> {
- PAOPENG> int c;
- PAOPENG>
- PAOPENG> printf("\nPlease Enter the character: ");
- PAOPENG> c =getchar();
- PAOPENG> while (c != EOF)
- PAOPENG> {
- PAOPENG> putchar(c);
- PAOPENG> c = getchar;
- ^^^^
- PAOPENG> }
- PAOPENG> }
-
- PAOPENG> Do anyone here know what wrong with this code?
-
-
-
-
- I'm not sure if it was your problem, but you forgot the parens
- afer getchar.
-
-
- You should have an interesting value stored in c! BTW, this is
- valid C code, although you'll get a warning about mixing pointers
- and integers.
-
-
-
- Kevin
-
-
-
-
-
-
-
-
- --
- Kevin J. Jarnot - Senior Software Engineer | mailto:jarnot@iddis.com
- IDD Information Services Waltham, MA | http://www-cs.canisius.edu/~jarnot
-